package com.zj.java21demo.service.impl;

import com.zj.java21demo.dto.UserQueryDto;
import com.zj.java21demo.entity.User;
import com.zj.java21demo.mapper.UserMapper;
import com.zj.java21demo.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zj.java21demo.utils.ResultVoUtil;
import com.zj.java21demo.vo.ResultVo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xiaoniuhululu
 * @since 2024-01-20 12:45:35
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Resource
    UserMapper userMapper;

    @Override
    public ResultVo queryUserByPage(UserQueryDto userQueryDto) {
        User user = new User();
        user.setAccount("aaa");
        user.setName("aaa");
        user.setPassword("123456");
        user.setCreateTime(new Date());
        user.setIsActive(1);
//        userMapper.selectById();

        userMapper.insert(user);

        return ResultVoUtil.success("操作成功",null);
    }
}
